import hyRequest from "../index";

import { IAcount, IDataType } from './type'

enum LoginAPI {
  AccountLogin = '/login',
  loginUserInfo = '/users/',
  UserMenus = '/role/'
}

export function accountLoginRequest(account: IAcount){
  return hyRequest.post<IDataType>({
    url: LoginAPI.AccountLogin,
    data:account
  })
}

export function requestUserInfoById(id: number){
  return hyRequest.get<IDataType>({
    url:LoginAPI.loginUserInfo + id
  })
}

export function requestUserMenusByRoleId(id: number) {
  return hyRequest.get<IDataType>({
    url:LoginAPI.UserMenus + id +'/menu'
  })
}
